Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Prepare fiest release #4

Merged
merged 1 commit into from
Nov 4, 2023
Merged

[chore] Prepare fiest release #4

merged 1 commit into from
Nov 4, 2023

Conversation

baseballyama
Copy link
Owner

No description provided.

@baseballyama baseballyama force-pushed the first-release branch 4 times, most recently from fb0a9d3 to cb829f6 Compare November 4, 2023 13:06
Copy link

changeset-bot bot commented Nov 4, 2023

🦋 Changeset detected

Latest commit: 458e24c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ai-craftsman Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@baseballyama baseballyama force-pushed the first-release branch 4 times, most recently from a439aa3 to a325654 Compare November 4, 2023 14:23
Comment on lines 31 to +35
if (codingGuide.path != null && codingGuide.level != null) {
const markdown = await fs.promises.readFile(codingGuide.path, "utf-8");
const parsed = parseMarkdown(markdown);
return chunkMarkdownByLevel(parsed, codingGuide.level);
const chunked = chunkMarkdownByLevel(parsed, codingGuide.level);
return chunked.filter((chunk) => codingGuide.enablePattern.test(chunk));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定することが必要です。ここでは、markdownparsedchunkedの変数と、chunkMarkdownByLevel関数の引数と戻り値の型が指定されていません。これらに適切な型を指定してください。

Reference: ## 型定義の適用
Meta Content
Level 必須
Link https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
AI Review ON

説明

全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定すること。

理由

型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。

// 良いコードの例
function add(x: number, y: number): number {
  return x + y;
}

// 悪いコードの例
function add(x, y) {
  return x + y;
}

例外ケース

  • ライブラリが提供する関数や変数の型が any である場合は、適宜型アサーションを使用する。

リファクタリングガイドライン

既存のコードでは、任意の型が使われていた場合、それを具体的な型に置き換えていく。新規コードでは初めから型を適用する。


Comment on lines 29 to 30
reader: getEnv("CODING_GUIDE_READER") || undefined,
path: getEnv("CODING_GUIDE_PATH") || undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

各変数に対して型が明示的に指定されていません。型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。以下のように修正してください。

reader: string | undefined = getEnv("CODING_GUIDE_READER") || undefined,
path: string | undefined = getEnv("CODING_GUIDE_PATH") || undefined,
level: number | undefined = Number(getEnv("CODING_GUIDE_LEVEL")) || undefined,
enablePattern: RegExp = RegExp(
  getEnv("CODING_GUIDE_ENABLE_PATTERN", { defaultValue: ".*" })
),
Reference: ## 型定義の適用
Meta Content
Level 必須
Link https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
AI Review ON

説明

全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定すること。

理由

型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。

// 良いコードの例
function add(x: number, y: number): number {
  return x + y;
}

// 悪いコードの例
function add(x, y) {
  return x + y;
}

例外ケース

  • ライブラリが提供する関数や変数の型が any である場合は、適宜型アサーションを使用する。

リファクタリングガイドライン

既存のコードでは、任意の型が使われていた場合、それを具体的な型に置き換えていく。新規コードでは初めから型を適用する。


@baseballyama baseballyama merged commit 34f591b into main Nov 4, 2023
2 checks passed
@baseballyama baseballyama deleted the first-release branch November 4, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant